class Card extends System.Object
{
	var isFaceUp:boolean = false;	
	var minicard:boolean = false;
	
	var cardNum:int = 0;
	var cardFace:int = 1;
	
	var img:String;	
	
	function Card( _cardNum:int , _face:int)
	{
		setCard(_cardNum,_face);		
	}
	
	function setCard( _cardNum:int , _face:int)
	{		        
        var t_cardFace:String;
        var t_cardNum:String;

        cardFace = _face;

        if(_cardNum == 14)
            _cardNum=1;

        cardNum = _cardNum;

        if(_cardNum < 10)
            t_cardNum  = "0" + _cardNum.ToString();
        else
            t_cardNum  = _cardNum.ToString();
            
        
        Debug.Log(_cardNum.ToString());
            
        


        if( _face == 1)
            t_cardFace = "clover";
        if( _face == 2)
            t_cardFace = "dia";
        if( _face == 3)
            t_cardFace = "heart";
        if( _face == 4)
            t_cardFace = "spade";


        var cardFName:String;

        if( minicard == true )
        {
            if(cardNum==0)                
                cardFName = "img/card/sback";
            else
                cardFName = "img/card/" + t_cardFace + "/S" + t_cardNum;

            //rect.width=23;
            //rect.height=29;

        }
        else
        {
            if(cardNum==0)
                cardFName = "img/card/back";                
            else
                cardFName = "img/card/" + t_cardFace + "/B" + t_cardNum ;

            //rect.width=43;
            //rect.height=54;

        }

        img = cardFName;        
        
     }
		
}